import { View ,Image} from '@tarojs/components'
import placerlogo from '../../assets/images/zhqh.jpeg'
import React, { useState, } from 'react'

type zImageType = {
    src:string,
    className?:string
}

const ZImage = (props:zImageType)=>{
    const {src,className} = props
    const [imageSrc, setImageSrc] = useState(src)
    const handleImageError = () => {
      setImageSrc(placerlogo)
    }

    return <>
        <Image className={className} src={imageSrc} onError={handleImageError}></Image>
    </>

}

export default React.memo(ZImage)